<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "test_account".
 *
 * @property integer $id
 * @property string $name
 * @property string $password
 * @property integer $pro_id
 *
 * @property Project $pro
 */
class TestAccount extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'test_account';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['name', 'password', 'pro_id'], 'required'],
            [['pro_id'], 'integer'],
            [['name', 'password'], 'string', 'max' => 32]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Tên tài khoản',
            'password' => 'Mật khẩu',
            'pro_id' => 'Dự án',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getPro()
    {
        return $this->hasOne(Project::className(), ['id' => 'pro_id']);
    }
}
